﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace cubo
{
    class Camera
    {
        public Vector3 posicaoCamera;
        public Vector3 apontaCamera;
        public Vector3 cimaCamera;
        private Matrix projecao;

        public void inicializar(Vector3 posicao, Vector3 apontamento, Vector3 cima)
        {
            posicaoCamera = posicao;
            apontaCamera = apontamento;
            cimaCamera = cima;
        }

        public Matrix getView()
        {
            return Matrix.CreateLookAt(posicaoCamera, apontaCamera, cimaCamera);
        }

        public void setProjecao(float ratio)
        {
            projecao = Matrix.CreatePerspectiveFieldOfView(
                        MathHelper.PiOver4,
                        ratio,
                        1.0f,
                        500.0f);
        }

        public Matrix getProjecao()
        {
            return projecao;
        }
    }
}
